package cn.flant.io.tools;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;

public class BytePiped {
	private InputStream inputStream = null;
	private OutputStream outputStream = null;

	private BytePiped() throws IOException {
		PipedInputStream inputStream = new PipedInputStream();
		PipedOutputStream outputStream = new PipedOutputStream(inputStream);
		this.inputStream = inputStream;
		this.outputStream = outputStream;
	}

	public static BytePiped open() throws IOException {
		return new BytePiped();
	}

	public OutputStream getOutputStream() {
		return outputStream;
	}

	public InputStream getInputStream() {
		return inputStream;
	}
}
